Skip to content

Rework #[recursively_pinned] to prevent unwanted direct initialization#892

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_905032075
Apr 27, 2026
Merged

Rework #[recursively_pinned] to prevent unwanted direct initialization#892
copybara-service[bot] merged 1 commit intomainfrom
test_905032075

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service Bot commented Apr 24, 2026

Rework #[recursively_pinned] to prevent unwanted direct initialization

  • Replaced the #[non_exhaustive] attribute with a private field of type alias ctor::macro_internal::MustUseCtorToInitialize.
  • Appended the hidden field at the back for unnamed fields (tuple structs/variants) to preserve field index alignment.
  • Note: This means that DST tuple structs/variants are not supported due to the requirement that the unsized field must be the last field, which conflicts with the hidden field insertion.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 24, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service copybara-service Bot force-pushed the test_905032075 branch 6 times, most recently from 8224afd to b64abc5 Compare April 27, 2026 19:33
- Replaced the `#[non_exhaustive]` attribute with a private field of type alias `ctor::macro_internal::MustUseCtorToInitialize`.
- Appended the hidden field at the back for unnamed fields (tuple structs/variants) to preserve field index alignment.
- Note: This means that DST tuple structs/variants are not supported due to the requirement that the unsized field must be the last field, which conflicts with the hidden field insertion.

PiperOrigin-RevId: 906497692
@copybara-service copybara-service Bot merged commit c27f41f into main Apr 27, 2026
@copybara-service copybara-service Bot deleted the test_905032075 branch April 27, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants